<template>
  <div class="nav">
    <el-icon><HomeFilled /></el-icon>
    <span> / 会员中心</span>
  </div>
  <div class="user">
    <div class="left">
      <el-menu
        :default-active="$route.path"
        class="el-menu-vertical-demo"
        active-text-color="#1890ff"
        text-color="#7f7f7f"
      >
        <el-menu-item
          index="/user/certification"
          @click="changeActive('/user/certification')"
        >
          <el-icon><icon-menu /></el-icon>
          <span>实名认证</span>
        </el-menu-item>
        <el-menu-item index="/user/order" @click="changeActive('/user/order')">
          <el-icon><icon-menu /></el-icon>
          <span>挂号订单</span>
        </el-menu-item>
        <el-menu-item
          index="/user/patient"
          @click="changeActive('/user/patient')"
        >
          <el-icon><icon-menu /></el-icon>
          <span>就诊人管理</span>
        </el-menu-item>
        <el-menu-item
          index="/user/profile"
          @click="changeActive('/user/profile')"
        >
          <el-icon><icon-menu /></el-icon>
          <span>账号信息</span>
        </el-menu-item>
        <el-menu-item
          index="/user/feedback"
          @click="changeActive('/user/feedback')"
        >
          <el-icon><icon-menu /></el-icon>
          <span>信息反馈</span>
        </el-menu-item>
      </el-menu>
    </div>
    <div class="right">
      <!-- <el-skeleton :rows="5" /> -->
      <!-- <ElSkeleton :rows="5" /> -->
      <router-view></router-view>
    </div>
  </div>
</template>

<script setup lang="ts">
import { HomeFilled, Menu as IconMenu } from "@element-plus/icons-vue";
import { useRouter } from "vue-router";
let $router = useRouter();
// 左侧菜单点击事件的回调
const changeActive = (path: string) => {
  $router.push({ path });
};
</script>

<style scoped lang="scss">
.nav {
  margin: 20px 0 20px 25px;
  color: #7f7f7f;
  font-size: 14px;
  display: flex;
  span {
    margin-left: 5px;
  }
}
.user {
  display: flex;
  flex-direction: row;
  .left {
    flex: 1.5;
    .el-menu-item {
      height: 50px;
      // color: #7f7f7f;
      font-size: 14px;
      // border: 1px solid red;
      &:hover {
        .el-icon {
          color: #409eff;
          transition-duration: 0.4s;
        }
        background-color: #ffffff;
      }
    }
    .is-active {
      background-color: #e6f7ff !important;
      span {
        color: #7f7f7f;
      }
    }
  }
  .right {
    flex: 8.5;
    padding-left: 20px;
  }
}
</style>
